<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<a href="https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx373650bf8de7f27d&redirect_uri=http%3A%2F%2Frs.bantianyaozg.com%2Fgood%2FMP_verify_lcASwdWqj1qcSlSc.txt&response_type=code&scope=snsapi_base&state=123&connect_redirect=1#wechat_redirect"
   id="gogogo">qqqqqqqqqq</a>

</body>

<script src="http://libs.baidu.com/jquery/2.0.0/jquery.js"></script>
<script type="application/javascript">

    $(function () {
        //let a = GetRequest();
    });

    function GetRequest() {
        var url = location.search; //获取url中"?"符后的字符串
        var theRequest = new Object();
        if (url.indexOf("?") != -1) {
            var str = url.substr(1);
            strs = str.split("&");
            for (var i = 0; i < strs.length; i++) {
                theRequest[strs[i].split("=")[0]] = (strs[i].split("=")[1]);
            }
        }
        return theRequest;
    }


    var str = "http://rs.bantianyaozg.com/good/MP_verify_lcASwdWqj1qcSlSc.txt?code=061jC3Ga1n0Pzz0W3EIa1DaYk93jC3G0&state=123";

    function GetQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = str.match(reg);
        if (r != null) return unescape(r[2]);
        return null;
    }

    // alert(GetQueryString("code"));


    var code = getUrlParam("code")
    alert(code);

    //window.location='http://rs.bantianyaozg.com/good/MP_verify_lcASwdWqj1qcSlSc.txt?code='+code+'&state=123';
    function getUrlParam(name) {

        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象

        var r = window.location.search.substr(1).match(reg);  //匹配目标参数

        if (r != null) return unescape(r[2]);

        return null; //返回参数值

    }


</script>
</html>